<template>
	<view class="cc">
		
	<view class="aa">
		<view>
			{{title}}
		</view>
		<view>
			<text :class="active==item.key?'bb':'ff'" v-for="(item,index) in list" :key="item.key" @click="add(item.key)">{{item.name}}</text>
		</view>
	</view>
	</view>
	
</template>

<script>
	export default {
		name: "singerlist",
		props: [ 'list', 'title'],
		data() {
			return {
				active:null,//定义的下标
			};
		},
		methods:{
			add(i){
				this.active=i
				this.$emit('add',i)
				// console.log(1)
			}
		}
	}
</script>

<style>
.aa{
	display: flex;
	overflow: auto;
	width: 2000px;
	height: 30px;
    align-items: center;
}
.cc{
	width: 100vw;
	overflow-x: auto;
}
.bb{
	border: 1px solid red;
	border-radius: 5px;
	margin-left: 8px;
	padding: 0 5px;
	color: red;
}
.ff{
	margin-left: 8px;
	padding: 0 5px;
}
</style>
